package com.hdu.exceptionHandler;


import com.hdu.result.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
@Slf4j
public class GlobalExceptionHandler {

    @ExceptionHandler(IllegalAccessException.class)
    public R handleIllegalAccessException(IllegalAccessException e) {
        log.error("IllegalAccessException:{}", e.getMessage());
        return R.fail(e.getMessage());
    }
}
